using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace FUSE
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class OptionScreen : Microsoft.Xna.Framework.GameComponent
    {
        Boolean hasSelected;
        private int playerSelection;
        // TODO: Add your update code here
        Texture2D High;
        KeyboardState playerInput = new KeyboardState();


        public OptionScreen(Game game)
            : base(game)
        {
            // TODO: Construct any child components here
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here

            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
       public override void Update(GameTime gameTime)
        {

            while(!hasSelected)
            {
                if(playerInput.IsKeyUp(Keys.Up) )
                {
                    incrementPlayerSelection();
                }
                else if(playerInput.IsKeyDown(Keys.Down))
                {
                    decrementPlayerSelection();
                }

                if (playerSelection == 0)
                {
                    //if choice 0 --> play
                        //highlight  button
                }
                if (playerSelection == 1)
                {
                    //if choice 1 --> options
                        //highlight button
                }

                base.Update(gameTime);
            }
            
            
        }

        private void incrementPlayerSelection()
        {
            if (playerSelection <= 2)
            {
                playerSelection++;
            }
        }

        private void decrementPlayerSelection()
        {
            if (playerSelection >= 1)
            {
                playerSelection--;
            }
        }
    }
}
